<form action="<?=base_url()?>utama/save_proyek" method="post">
	<div id="main_content">
		<div class="grid_6">
			<div class="box">
				<div class="header">
					<h3>
						Tambah Proyek
					</h3>
				</div>
				<div class="content no-padding with-actions">
					<div class="section _100">
						<label for="nama_proyek">
							Nama Proyek
						</label>
						<div>
							<input maxlength="45" class="required" name="nama_proyek" id="nama_proyek"/>
						</div>
					</div>
					<div class="section _100">
						<label for="pemilik_proyek">
							Nama Client
						</label>
						<div>
							<input maxlength="45" class="required" name="pemilik_proyek" id="pemilik_proyek"/>
						</div>
					</div>
					<div class="section _100">
						<label for="penanggung_jawab">
							Penanggung Jawab
						</label>
						<div>
							<input maxlength="45" class="required" name="penanggung_jawab" id="penanggung_jawab"/>
						</div>
					</div>
					<div class="section _100">
						<label for="total_dana">
							Total Dana
						</label>
						<div>
							<input class="required digits" name="total_dana" id="total_dana"/>
						</div>
					</div>
					<div class="section _100">
						<label for="tanggal_mulai">
							Tanggal Mulai
						</label>
						<div>
							<input class="required dateISO" name="tanggal_mulai" id="tanggal_mulai"/>
						</div>
					</div>
					<div class="section _100">
						<label for="tanggal_deadline">
							Tanggal Deadline
						</label>
						<div>
							<input class="required dateISO" name="tanggal_deadline" id="tanggal_deadline"/>
						</div>
					</div>
					<div class="section _100" style="padding-bottom: 20px">
						<label for="pegawai_terlibat">
							Pegawai Terlibat
						</label>
							<?php foreach ($pegawai as $row){?>
							<div style="padding-top: 10px">
								<input type="checkbox" class="required" name="idPegawai[]" value="<?= $row["idPegawai"]?>"/><?=$row["nama_pegawai"]?><br/>
							</div>
							<?php }?>
					</div>
					<div class="actions" style="padding-bottom: 5px; padding-top: 5px;">
						<div class="actions-right">
							<input type="submit" value="Simpan"/>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</form>
<script type="text/javascript">
$(function(){
	$("#tanggal_mulai").datepicker({dateFormat:'yy-mm-dd'});
});

$(function(){
	$("#tanggal_deadline").datepicker({dateFormat:'yy-mm-dd'});
});
</script>
<script type="text/javascript">
	//<![CDATA[
    $(window).load(function () {
		var a = $("form").validate({
			invalidHandler: function (d, b) {
				var e = b.numberOfInvalids();
				if (e) {
					var c = e == 1 ? "Anda hanya mengisi 1 field, field kosong telah ditandai" : "Anda tidak mengisi " + e + " fields. Field tersebut telah ditandai.";
					$(".box .content").removeAlertBoxes();
					$(".box .content").alertBox(c, {
						type: "warning",
						icon: true,
						noMargin: false
					});
					$(".box .content .alert").css({
						width: "",
						margin: "0",
						borderLeft: "none",
						borderRight: "none",
						borderRadius: 0
					})
				} else {
					$(".box .content").removeAlertBoxes()
				}
			},
			showErrors: function (c, d) {
				this.defaultShowErrors();
				var b = this;
				$.each(d, function () {
					var f = $(this.element);
					var e = f.parent().find("label.error").hide();
					e.addClass("red");
					e.css("width", "");
					f.trigger("labeled");
					e.fadeIn()
				})
			},
			submitHandler: function (b) {
				$("form").submit();
			}
		})
	});
    //]]>
</script>